//
//  RJBarBottom.m
//  AirQuality
//
//  Created by Po on 15/4/3.
//  Copyright (c) 2015年 Po. All rights reserved.
//

#import "RJBarBottom.h"

@interface RJBarBottom ()

@property (retain, nonatomic) UILabel * titleLabel;

@end

@implementation RJBarBottom

- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setBackgroundColor:[UIColor clearColor]];
        [self addSubview:[self getTitleLabel:title]];
    }
    return self;
}

- (UILabel *)getTitleLabel:(NSString *)title
{
    if ([title isEqualToString:@"PM2_5"]) {
        title = @"PM₂.₅";
    }
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:self.bounds];
        if (DeviceType < 6) {
            [_titleLabel setFont:[UIFont systemFontOfSize:9]];
        } else {
            [_titleLabel setFont:[UIFont boldSystemFontOfSize:13]];
        }
        [_titleLabel setTextColor:[UIColor whiteColor]];
        [_titleLabel setTextAlignment:NSTextAlignmentCenter];
        [_titleLabel setText:title];

    }
    return _titleLabel;
}





















@end
